package com.wangnan.currentactivity.Dao;

import java.util.List;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

/*
 * Package    :com.wangnan.currentactivity.Dao
 * ClassName  :BillListDao
 * Description:
 * Data       :2021/1/27/027 14:26
 */
@Dao //DateBase access Object
public interface BillListDao {

	@Insert
		//   添加
	void insertBillLists(BillList... billLists);

	@Update
		//   更新
	void updateBillLists(BillList... billLists);

	@Delete
		//   删除
	void deleteBillLists(BillList... billLists);

	@Query("DELETE FROM BillList")
		//清空全部
	void deleteAllBillLists();

	@Query("SELECT * FROM BillList ORDER BY ID DESC")
		//降序
		//	List<BillList> getAllBillLists();
	LiveData<List<BillList>> getAllBillLists();
}
